﻿<Page x:Class="WinChrome.VS2012Demo.Pages.DemoPage2"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      mc:Ignorable="d" 
      d:DesignHeight="300" d:DesignWidth="300"
	Title="DemoPage2">
    <Page.Resources>
        <Style x:Key="colourButtonStyle" TargetType="Button">
            <Setter Property="Width" Value="32"/>
            <Setter Property="Height" Value="32"/>
            <Setter Property="Command" Value="{Binding SetColorCommand}" />
            <Setter Property="CommandParameter" Value="{Binding RelativeSource={RelativeSource Self}, Path=Background.Color}"/>
            <Setter Property="Margin" Value="3"/>
        </Style>
    </Page.Resources>
    
    <StackPanel Orientation="Horizontal" VerticalAlignment="Top">
        <TextBlock VerticalAlignment="Center" Margin="6,0">Pick a colour</TextBlock>
        <Button Background="LimeGreen" Style="{StaticResource colourButtonStyle}"/>
        <Button Background="Purple" Style="{StaticResource colourButtonStyle}"/>
        <Button Background="#CA5100" Style="{StaticResource colourButtonStyle}" />
        <Button Background="{DynamicResource {x:Static SystemColors.HotTrackBrushKey}}" Style="{StaticResource colourButtonStyle}"/>        
    </StackPanel>
</Page>
